package com.neusoft.tijian.controller;

import com.neusoft.tijian.po.Setmeal;
import com.neusoft.tijian.service.SetmealService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 套餐控制器
 * 处理套餐相关的前端请求
 */
@RestController
@RequestMapping("/setmeal")  // 匹配前端baseURL中的tijiancms上下文
public class SetmealController {

	@Autowired
	private SetmealService setmealService;

	/**
	 * 查询所有套餐
	 * 对应前端请求：setmeal/listSetmeal
	 */
	@GetMapping("/listAllSetmeal")  // 与前端请求路径完全匹配
	public List<Setmeal> listSetmeal() {
		return setmealService.listAllSetmeal();
	}
}
